;
; SOUNDBOX.SH Version 1.01 (C)1995,1996 HUDSON SOFT
; HuC6230(SOUNDBOX)関連 アセンブラ用ヘッダーファイル(SOUNDBOX.SH)
;
	ifndef	_SOUNDBOX_SH_
_SOUNDBOX_SH_	equ	1
;
ADP_RESET_0	equ	$10
ADP_RESET_1	equ	$20
ADP_RESET_ALL	equ	$30
;
ADP_LINER_OFF	equ	$00
ADP_LINER_ON	equ	$0c
SB_ADPCM_0	equ	1
SB_ADPCM_1	equ	2
SB_ADPCM_ALL	equ	3
;
ADPCM_RATE32	equ	0
ADPCM_RATE16	equ	1
ADPCM_RATE8	equ	2
ADPCM_RATE4	equ	3
;
;m_adp_cr	equ	$18
;
;--- Macros
;
	include	"c62dev.sh"
;
_put_sb_chsel	macro	value
		mov.b	value,at
		out.b	at,IO_SB_CHSEL(zero)
		endm
;
_put_sb_mvol	macro	value
		mov.b	value,at
		out.b	at,IO_SB_MVOL(zero)
		endm
;
_put_sb_frql	macro	value
		mov.b	value,at
		out.b	at,IO_SB_FRQL(zero)
		endm
;
_put_sb_frqh	macro	value
		mov.b	value,at
		out.b	at,IO_SB_FRQH(zero)
		endm
;
_put_sb_chvol	macro	value
		mov.b	value,at
		out.b	at,IO_SB_CHVOL(zero)
		endm
;
_put_sb_pan	macro	value
		mov.b	value,at
		out.b	at,IO_SB_PAN(zero)
		endm
;
_put_sb_wave	macro	value
		mov.b	value,at
		out.b	at,IO_SB_WAVE(zero)
		endm
;
_put_sb_noise	macro	value
		mov.b	value,at
		out.b	at,IO_SB_NOISE(zero)
		endm
;
_put_sb_lfpfrq	macro	value
		mov.b	value,at
		out.b	at,IO_SB_LFOFRQ(zero)
		endm
;
_put_sb_lfocr	macro	value
		mov.b	value,at
		out.b	at,IO_SB_LFOCR(zero)
		endm
;
_put_sb_adp_cr	macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_CR(zero)
		endm
;
_put_sb_adp_voll0	macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLL0(zero)
		endm
;
_put_sb_adp_volr0	macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLR0(zero)
		endm
;
_put_sb_adp_voll1	macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLL1(zero)
		endm
;
_put_sb_adp_volr1	macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLR1(zero)
		endm
;
_put_sb_pcm_voll	macro	value
		mov.b	value,at
		out.b	at,IO_SB_PCM_VOLL(zero)
		endm
;
_put_sb_pcm_volr	macro	value
		mov.b	value,at
		out.b	at,IO_SB_PCM_VOLR(zero)
		endm
;
;--------------------------------------------------------------
_chseli		macro	value
		mov.b	value,at
		out.b	at,IO_SB_CHSEL(zero)
		endm
;
_mvoli		macro	value
		mov.b	value,at
		out.b	at,IO_SB_MVOL(zero)
		endm
;
_frqli		macro	value
		mov.b	value,at
		out.b	at,IO_SB_FRQL(zero)
		endm
;
_frqhi		macro	value
		mov.b	value,at
		out.b	at,IO_SB_FRQH(zero)
		endm
;
_chvoli		macro	value
		mov.b	value,at
		out.b	at,IO_SB_CHVOL(zero)
		endm
;
_pani		macro	value
		mov.b	value,at
		out.b	at,IO_SB_PAN(zero)
		endm
;
_wavei		macro	value
		mov.b	value,at
		out.b	at,IO_SB_WAVE(zero)
		endm
;
_noisei		macro	value
		mov.b	value,at
		out.b	at,IO_SB_NOISE(zero)
		endm
;
_lffrqi		macro	value
		mov.b	value,at
		out.b	at,IO_SB_LFOFRQ(zero)
		endm
;
_lfocri		macro	value
		mov.b	value,at
		out.b	at,IO_SB_LFOCR(zero)
		endm
;
_acri		macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_CR(zero)
		endm
;
_avll0i		macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLL0(zero)
		endm
;
_avlr0i		macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLR0(zero)
		endm
;
_avll1i		macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLL1(zero)
		endm
;
_avlr1i		macro	value
		mov.b	value,at
		out.b	at,IO_SB_ADP_VOLR1(zero)
		endm
;
_pvlli		macro	value
		mov.b	value,at
		out.b	at,IO_SB_PCM_VOLL(zero)
		endm
;
_pvlri		macro	value
		mov.b	value,at
		out.b	at,IO_SB_PCM_VOLR(zero)
		endm
;
_chsel		macro	reg
		out.b	reg,IO_SB_CHSEL(zero)
		endm
;
_mvol		macro	reg
		out.b	reg,IO_SB_MVOL(zero)
		endm
;
_frql		macro	reg
		out.b	reg,IO_SB_FRQL(zero)
		endm
;
_frqh		macro	reg
		out.b	reg,IO_SB_FRQH(zero)
		endm
;
_chvol		macro	reg
		out.b	reg,IO_SB_CHVOL(zero)
		endm
;
_pan		macro	reg
		out.b	reg,IO_SB_PAN(zero)
		endm
;
_wave		macro	reg
		out.b	reg,IO_SB_WAVE(zero)
		endm
;
_noise		macro	reg
		out.b	reg,IO_SB_NOISE(zero)
		endm
;
_lffrq		macro	reg
		out.b	reg,IO_SB_LFOFRQ(zero)
		endm
;
_lfocr		macro	reg
		out.b	reg,IO_SB_LFOCR(zero)
		endm
;
_acr		macro	reg
		out.b	reg,IO_SB_ADP_CR(zero)
		endm
;
_avll0		macro	reg
		out.b	reg,IO_SB_ADP_VOLL0(zero)
		endm
;
_avlr0		macro	reg
		out.b	reg,IO_SB_ADP_VOLR0(zero)
		endm
;
_avll1		macro	reg
		out.b	reg,IO_SB_ADP_VOLL1(zero)
		endm
;
_avlr1		macro	reg
		out.b	reg,IO_SB_ADP_VOLR1(zero)
		endm
;
_pvll		macro	reg
		out.b	reg,IO_SB_PCM_VOLL(zero)
		endm
;
_pvlr		macro	reg
		out.b	reg,IO_SB_PCM_VOLR(zero)
		endm
;
;
;--- Structs
;
ADPVOL		struct
avoll0		ds	1
avolr0		ds	1
avoll1		ds	1
avolr1		ds	1
	align	4
		ends
;
PCMVOL		struct
pvoll:		ds	1
pvolr:		ds	1
	align	4
		ends
;
	globl	init_soundbox
	globl	reset_adp
	globl	set_adp_liner,set_adp_vol,set_adp_rate,set_pcm_vol
;
	endif	; !_SOUNDBOX_SH_
